package com.orange.user.common;


import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.Data;

import java.util.List;

@Data
public class PageVO<T> {

    private List<T> records;
    private long total;
    private long pageNum;
    private long pageSize;

    public PageVO(List<T> records, int total, int pageNum, int pageSize) {
        this.records = records;
        this.total = total;
        this.pageNum = pageNum;
        this.pageSize = pageSize;
    }

    public PageVO(IPage<T> page){
        this.records = page.getRecords();
        this.total =  page.getTotal();
        this.pageNum = page.getCurrent();
        this.pageSize = page.getSize();

    }
}
